var FlashCookie = {
	id : 'flashcookie' + Math.floor(Math.random()*10000),
	cookie : null,
	init : function(){
		var flash = '<object id="'+this.id+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="0" height="0"><param name="movie" value="http://localhost:800/SMK/js/fcookie/flashcookie.swf" /><param name="quality" value="high" /><embed src="http://localhost:800/SMK/js/fcookie/flashcookie.swf" quality="high"  width="0" height="0" name="'+this.id+'" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed></object>';
  		var d = document.createElement('div');
		d.innerHTML = flash;
		document.body.appendChild(d);
	},
	onReady : function(){
		this.cookie = this.getFlash(this.id);
		if(window['onFlashCookieReady']) {
			onFlashCookieReady(this);
		}
	},
	set : function(key, value){
		if(this.checkAvailable()) {
			this.cookie.set(key, value);
		}
	},
	get : function(key){
		if(this.checkAvailable()) {
			return this.cookie.get(key);
		}
		return null;
	},
	del : function(key) {
		if(this.checkAvailable()) {
			this.cookie.del(key);
		}
	},
	clear : function() {
		if(this.checkAvailable()) {
			this.cookie.clear();
		}
	},
	checkAvailable : function() {
		return (this.cookie != null);
	},
	getFlash : function(id){
		if (navigator.appName.indexOf("Microsoft") != -1) {
			return window[id];
		} else {
			return document[id];
		}
	}
};
(function () {
	var ie  = !!(window.attachEvent && !window.opera);
	var wk  = /webkit\/(\d+)/i.test(navigator.userAgent) && (RegExp.$1 < 525);
	var fn  = [];
	var run = function () { for (var i = 0; i < fn.length; i++) fn[i](); };
	var d   = document;
	d.ready = d.ready || function (f) {
		if (!ie && !wk && d.addEventListener)
			return d.addEventListener('DOMContentLoaded', f, false);
		if (fn.push(f) > 1) return;
		if (ie)
			(function () {
				try { d.documentElement.doScroll('left'); run(); }
				catch (err) { setTimeout(arguments.callee, 0); }
			})();
		else if (wk)
			var t = setInterval(function () {
				if (/^(loaded|complete)$/.test(d.readyState))
					clearInterval(t), run();
			}, 0);
	};
})();
document.ready(function(){
	FlashCookie.init();
});